package com.ss.android.download;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;

import com.ss.android.article.browser.R;
import com.ss.android.common.download.e;

public class DownloadDeleteActivity extends Activity {
    private Uri a;
    private Intent b;

    public DownloadDeleteActivity() {

    }

    protected void onNewIntent(Intent arg1) {
        super.onNewIntent(arg1);
        this.setIntent(arg1);
    }

    protected void onResume() {
        long v2_1;
        String v0_3;
        Intent v2 = null;
        super.onResume();
        Intent v0 = this.getIntent();
        this.b = v0;
        if (v0 == null) {
            return;
        }

        this.setIntent(v2);
        if (this.b == null) {
            return;
        }

        this.a = this.b.getData();
        if (this.a == null) {
            return;
        }

        Cursor v1 = k.a(this.getApplicationContext()).a(this.a, ((String[]) null), ((String) null), ((String[]) null), ((String) null));
        try {
            if (v1.moveToFirst()) {
                if (!v1.moveToFirst()) {
                    return;
                }
                v0_3 = v1.getString(v1.getColumnIndexOrThrow("title"));
                v2_1 = v1.getLong(v1.getColumnIndexOrThrow("_id"));
                if (v1 == null) {
                    if (!TextUtils.isEmpty(((CharSequence) v0_3))) {
                        int v4_1 = R.string.notification_download_delete;
                        v0_3 = String.format(this.getString(v4_1), v0_3);
                        e v4_2 = android.support.design.a.v(((Context) this));
                        v4_2.a(com.ss.android.article.browser.R.string.tip).a(v0_3).a(com.ss.android.article.browser.R.string.label_ok, new d(this, v2_1)).b(com.ss.android.article.browser.R.string.label_cancel, new c(this)).a(new b(this));
                        v4_2.a();
                        return;
                    }
                    Log.w("DownloadDeleteActivity", "Missing appName; skipping handle");
                    return;
                }
                return;
            }

            Log.e("SsDownloadManager", "Empty cursor for URI " + this.a);
            if (v1 == null) {
                return;
            }
        } catch (Exception v0_1) {
            try {
                v1.close();
            } catch (Exception e) {
            }
        }
    }
}

